package com.hjn.spring.pojo;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

@Component("person")
public class Person {
  @Value("zhangsan")
  private String name;

  @Value("12")
  private int age;

  private String addree;

  public Person() {
    System.out.println("person被初始化了");
  }

  public String getName() {
    return name;
  }

  public void setName(String name) {
    this.name = name;
  }

  public int getAge() {
    return age;
  }

  public void setAge(int age) {
    this.age = age;
  }

  public String getAddree() {
    return addree;
  }

  public void setAddree(String addree) {
    this.addree = addree;
  }

  @Override
  public String toString() {
    return "Person{" + "name='" + name + '\'' + ", age=" + age + ", addree='" + addree + '\'' + '}';
  }
}
